options {
  directory "/var/cache/bind";

<% if !@bind[:forwarders].nil? -%>
  forwarders {
<% @bind[:forwarders].flatten.compact.uniq.each do |forwarder| -%>
    <%= forwarder %>;
<% end -%>
  };

<% end -%>
  lame-ttl 0;
  max-cache-ttl 5;
  max-ncache-ttl 5;

  dnssec-validation no;
  auth-nxdomain no;
  listen-on-v6 { any; };
};

include "/etc/bind/rndc.key";

controls {
  inet 127.0.0.1 allow { 127.0.0.1; } keys { "rndc-key"; };
};

// prime the server with knowledge of the root servers
zone "." {
  type hint;
  file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
  type master;
  file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
  type master;
  file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
  type master;
  file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
  type master;
  file "/etc/bind/db.255";
};
